package com.base.cn.platform.os.common.logger;

/**
 * PV类型
 *
 * @author s.li
 * @date 2019/04/02
 */
public enum PageViewEnum {

    PC_INDEX("PC","/web/index","PC首页"),
    PC_COURSE_LIST("PC","/web/course/courseList","PC课程列表"),
    PC_LIVE_LIST("PC","/web/course/liveIndex","PC直播列表"),
    PC_EXAM_INDEX("PC","/web/exam/index/examIndex","PC考试首页"),
    PC_TEACHER_LIST("PC","/web/teacher/list","PC直讲师表"),
    PC_CLASS_INDEX("PC","/web/classes/index","PC班级首页"),
    PC_QA_INDEX("PC","/web/qa/listQuestion","PC问答首页"),
    PC_CMS_INDEX("PC","/web/article/articleIndex","PC资讯首页"),
    PC_BOOK_LIST("PC","/web/book/list","PC图书列表"),
    PC_OPEN_LIST_INDEX("PC","/web/course/open/index","PC免费直播"),

    MOBILE_INDEX("MOBILE","/mobile/index","H5首页"),
    MOBILE_COURSE_LIST("MOBILE","/mobile/course/courseList","H5课程列表"),
    MOBILE_LIVE_LIST("MOBILE","/mobile/course/liveIndex","H5直播列表"),
    MOBILE_EXAM_INDEX("MOBILE","/mobile/exam/examIndex","H5考试首页"),
    MOBILE_TEACHER_LIST("MOBILE","/mobile/teacher/teacherList","H5直讲师表"),
    MOBILE_CLASS_INDEX("MOBILE","/mobile/class/index","H5班级首页"),
    MOBILE_CMS_INDEX("MOBILE","/mobile/article/opArticleList","H5资讯列表"),
    MOBILE_OPEN_LIST_INDEX("MOBILE","/mobile/open/history","H5免费直播"),

    IOS_INDEX("IOS","/api/index/indexDataOne","IOS首页"),
    IOS_COURSE_LIST("IOS","/api/course/getAllCourseList","IOS课程列表"),
    IOS_LIVE_LIST("IOS","/api/course/liveCourseList","IOS直播列表"),
    IOS_EXAM_INDEX("IOS","/api/exam/examIndexUserData","IOS考试首页"),
    IOS_TEACHER_LIST("IOS","/api/teacher/getTeacherList","IOS直讲师表"),
    IOS_CLASS_INDEX("IOS","/api/classes/getClassesList","IOS班级列表"),
    IOS_CMS_INDEX("IOS","/api/article/findArticleList","IOS资讯列表"),
    IOS_OPEN_LIST_INDEX("IOS","/api/openCourse/queryOpenList","IOS免费直播"),

    AN_INDEX("ANDROID","/api/index/indexDataOne","安卓首页"),
    AN_COURSE_LIST("ANDROID","/api/course/getAllCourseList","安卓课程列表"),
    AN_LIVE_LIST("ANDROID","/api/course/liveCourseList","安卓直播列表"),
    AN_EXAM_INDEX("ANDROID","/api/exam/examIndexUserData","安卓考试首页"),
    AN_TEACHER_LIST("ANDROID","/api/teacher/getTeacherList","安卓直讲师表"),
    AN_CLASS_INDEX("ANDROID","/api/classes/getClassesList","安卓班级列表"),
    AN_CMS_INDEX("ANDROID","/api/article/findArticleList","安卓资讯列表"),
    AN_OPEN_LIST_INDEX("ANDROID","/api/openCourse/queryOpenList","安卓免费直播"),

    APPLET_INDEX("APPLET","/api/index/indexDataOne","小程序首页"),
    APPLET_COURSE_LIST("APPLET","/api/course/getAllCourseList","小程序课程列表"),
    APPLET_LIVE_LIST("APPLET","/api/course/liveCourseList","小程序直播列表"),
    APPLET_EXAM_INDEX("APPLET","/api/exam/examIndexUserData","小程序考试首页"),
    APPLET_TEACHER_LIST("APPLET","/api/teacher/getTeacherList","小程序直讲师表"),
    APPLET_CLASS_INDEX("APPLET","/api/classes/getClassesList","小程序班级列表"),
    APPLET_CMS_INDEX("APPLET","/api/article/findArticleList","小程序资讯列表"),
    APPLET_OPEN_LIST_INDEX("APPLET","/api/openCourse/queryOpenList","小程序免费直播");

    private String form;
    private String uri;
    private String name;

    PageViewEnum(String form,String uri,String name){
        this.form = form;
        this.uri = uri;
        this.name = name;
    }

    public static PageViewEnum isUriContains(String from,String uri){
        PageViewEnum pageViewEnum = null;
        if(uri !=null && uri.trim().length() >0){
            PageViewEnum[] arr = PageViewEnum.values();
            for(PageViewEnum pve : arr){
                if(pve.getUri().equals(uri) && from.equals(pve.getForm())){
                    pageViewEnum = pve;
                    break;
                }
            }
        }
        return pageViewEnum;
    }

    public String getForm() {
        return form;
    }

    public void setForm(String form) {
        this.form = form;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
